import 'package:flutter/material.dart';
import 'package:flutter_changdian_football/widget/screenutil/custom_screenutil.dart';
import 'package:get/get.dart';

class ShowSheetUtils {

  static show(String title, {
    Function? onTap,
    Function? onCleanTap
  }) {
    showModalBottomSheet(
      context: Get.context!,
      backgroundColor: Colors.transparent,
      isDismissible: false,
      builder: (context) {
        return Material(
          color: Colors.white,
          borderRadius: BorderRadius.only(
            topLeft: Radius.circular(20.r),
            topRight: Radius.circular(20.r)
          ),
          child: Container(
            padding: EdgeInsets.symmetric(horizontal: 15.w),
            child: Column(
              mainAxisSize: MainAxisSize.min,
              children: [
                SizedBox(height: 20.w,),

                Container(
                  alignment: Alignment.centerLeft,
                  child: Text('温馨提示', style: TextStyle(fontSize: 16.sp, fontWeight: FontWeight.w500),),
                ),

                SizedBox(height: 20.w,),
                
                SizedBox(
                  child: Text(title, style: TextStyle(fontSize: 13.sp, color: Colors.grey),),
                ),

                SizedBox(height: 20.w,),

                SizedBox(height: 8.w,),

                SizedBox(
                  child: Row(
                    children: [
                      Expanded(
                        child: GestureDetector(
                          behavior: HitTestBehavior.translucent,
                          onTap: () {
                            Get.back();
                            onCleanTap?.call();
                          },
                          child: Container(
                            decoration: BoxDecoration(
                              color: const Color(0xffF6F6F6),
                              borderRadius: BorderRadius.circular(8.r)
                            ),
                            width: double.infinity,
                            alignment: Alignment.center,
                            padding: EdgeInsets.symmetric(vertical: 13.w),
                            child: Text('取消', style: TextStyle(fontSize: 15.sp, color: const Color(0xff1D1D1D), fontWeight: FontWeight.w500),),
                          ),
                        ),
                      ),

                      SizedBox(width: 15.w,),

                      Expanded(
                        child: GestureDetector(
                          behavior: HitTestBehavior.translucent,
                          onTap: () {
                            Get.back();
                            onTap?.call();
                          },
                          child: Container(
                            decoration: BoxDecoration(
                              color: const Color(0xff499360),
                              borderRadius: BorderRadius.circular(8.r)
                            ),
                            width: double.infinity,
                            alignment: Alignment.center,
                            padding: EdgeInsets.symmetric(vertical: 13.w),
                            child: Text('确定', style: TextStyle(fontSize: 15.sp, color: Colors.white, fontWeight: FontWeight.w500),),
                          ),
                        ),
                      )
                    ],
                  ),
                ),

                SizedBox(height: 30.w,)
              ],
            ),
          )
        );
      }
    );
  }

}